package com.hs.controller;


import com.hs.entity.pojo.Tag;
import com.hs.service.TagService;
import com.hs.utils.ResultResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hs
 * @since 2023-08-05
 */
@RestController
@RequestMapping("/tag")
@Api(tags = "标签")
public class TagController {

    @Resource
    private TagService tagService;

    @GetMapping("/all")
    @ApiOperation("获取所有动态标签")
    public ResultResponse<List<Tag>> getAllTags() {
        return tagService.getAllTags();
    }

    @GetMapping("/list")
    @ApiOperation("获取所有标签")
    public ResultResponse<List<Tag>> listAllTags() {
        return ResultResponse.ok(tagService.list());
    }
}

